Skip to content

fix(id): chunk clear_tag into at most MAX_CLEAR_CLAIMS claims per tag.clear event (#1720) - #1768

Merged
dezren39 merged 3 commits into
mainfrom
queue/1945-1720-clear-tag-chunk
Oct 29, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/1945-1720-clear-tag-chunk

Conversation

@dezren39

@dezren39 dezren39 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #1720.

LocalEvents::clear_tag collected every live claim of a name into ONE TagOp::Clear, and tag_claims::check_op refuses a clear naming more than MAX_CLEAR_CLAIMS (256) claims — so a name with >256 live claims on a subject could never be cleared, and every attempt failed.

Per the contract pinned by triage task 1936:

  • clear_tag now records one tag.clear event per chunk of at most MAX_CLEAR_CLAIMS claims (constant imported from tag_claims; no new literal), in the order tag_claims() returns them, until no live claim of the name remains.
  • Return contract (signature unchanged): the count is the total cleared across all chunks; the returned Hash is the FINAL chunk event's ID. Documented in the doc comment, including the append-only partial-failure semantics (earlier chunks stay recorded; a re-call clears the remainder).
  • Nothing-to-clear still errors; the ≤256 path records exactly one event, as before.

Tests (laptop, cargo test --lib local_events:: — 5 passed, 0 failed):

  • 257 live claims → exactly 2 clear events (256 + 1), returns 257 and the second event's ID, no live claim of the name remains; other names and the same name on other subjects untouched.
  • 600 live claims → 3 chunk events (256 + 256 + 88), all cleared.
  • ≤ cap → single event, same return; nothing-to-clear still errors.

Queue task 1945 (repo-health-code-pilot).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner October 28, 2026 18:23
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91f5c40a-a8dd-4759-952a-cdee7f34dc08
Commits

Reviewing files that changed from the base of the PR and between 114f01b and 19569f8.

Files selected for processing: 1
  • pkgs/id/src/local_events.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T23:35:26.367629Z 19569f8 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 62b0f2c869

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkgs/id/src/local_events.rs Outdated
None,
)?);
}
Ok((count, event.expect("at least one chunk was recorded")))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace the prohibited production expect

The new expect violates the explicit prohibition in pkgs/id/AGENTS.md, and Cargo.toml sets clippy::expect_used = "deny". Because this call is outside the test module's lint allowance, the clippy-lint recipe in pkgs/id/justfile rejects it, blocking the ci quality gate even though the nonempty-claims check makes the unwrap logically safe. Use fallible extraction or restructure the loop to return the final event without expect.

AGENTS.md reference: pkgs/id/AGENTS.md:L144-L144

Useful? React with 👍 / 👎.

@dezren39
dezren39 merged commit 17249b0 into main Oct 29, 2026
30 of 33 checks passed
@dezren39
dezren39 deleted the queue/1945-1720-clear-tag-chunk branch October 29, 2026 01:41
@dezren39
dezren39 restored the queue/1945-1720-clear-tag-chunk branch November 1, 2026 09:00
@dezren39
dezren39 deleted the queue/1945-1720-clear-tag-chunk branch November 1, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant